package com.lr.wfxmanager.permission.mapper;


import com.lr.wfxmanager.permission.bean.ParentFunctree;
import com.lr.wfxmanager.permission.bean.RoleGrant;
import com.lr.wfxmanager.permission.bean.RoleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;


@Mapper
public interface UserMapper {
    /*查询指定用户的权限树*/
    List<ParentFunctree> queryFunctree(@Param("account") String account);
    /*指定角色权限*/
    List<RoleGrant> queryGrantByRoleCode(@Param("roleCode") String roleCode);
    /*查询所有权限*/
    List<ParentFunctree> queryAllGrant();
    /*根据角色权限id取消权限*/
    void cancelRoleGrant(@Param("fid")Integer fid);
    /*添加指定角色权限*/
    void addRoleGrant(@Param("moduleCode")String moduleCode,@Param("roleCode")String roleCode);
    /*取消指定角色父节点(包括子节点权限)*/
    void cancelRoleGrants(@Param("moduleCode")String moduleCode,@Param("roleCode")String roleCode);
    /*查询子节点*/
    List<String> queryChildByParent(@Param("moduleCode")String moduleCode);
    /*查询所有角色*/
    List<RoleInfo> queryAllRoleInfo();
}
